#include "Timer.h"

Timer::Timer(): elapsedTime(0),lastUpdate(timeGetTime()){}

void Timer::Reset()
{
    elapsedTime = 0;
}

//consult system clock to update elapsedTime
void Timer::Update()
{
    long currTime = timeGetTime();
    elapsedTime += currTime - lastUpdate;
    lastUpdate = currTime;
}

//add specified to elapsedTime
void Timer::Update(long elapsedTime)
{
    this->elapsedTime += elapsedTime;
}

long Timer::GetElapsedTimeMillis()
{
    return elapsedTime;
}
